package org.wsiz.vro.repository;

import java.util.Date;
import org.springframework.stereotype.Service;
import org.wsiz.vro.domain.Account;
import org.wsiz.vro.domain.enums.Civility;
import org.wsiz.vro.util.ValueGenerator;

/**
 * Helper class to create transient entities instance for testing purposes.
 * Simple properties are pre-filled with random values.
 */
@Service
public class AccountGenerator {

    /**
     * Returns a new Account instance filled with random values.
     */
    public Account getAccount() {
        Account account = new Account();

        // simple attributes follows
        account.setLogin(ValueGenerator.getUniqueString(255));
        account.setPassword("a");
        account.setEmail(ValueGenerator.getUniqueEmail());
        account.setIsEnabled(true);
        account.setCivility(Civility.MR);
        account.setFirstName("a");
        account.setLastName("a");
        account.setBirthDate(new Date());
        return account;
    }

}